Thread: undefined reference to `RunSwmmDll(char*, char*, char*)'

  1. #1
    Registered User
    Join Date
    Oct 2011
    Posts
    2

    undefined reference to `RunSwmmDll(char*, char*, char*)'

    Hello,
    I have tried to 'google' this seemingly basic problem but all the suggestions I have found don't work.
    I have a calling program "trial_1.cpp" that calls a function "RunSwmmDll", that is declared in "swmm5_iface.h" and defined in "swmm5_iface.c"; all these files are attached to this message.
    In addition to the above mentioned files, all the other required files have also been added to the project.

    The problem is that all the time I try to build this project, it says undefined reference to 'RunSwmmDll(char*, char*, char*)'.
    I frankly speaking can't figure out what the cause of this error is!!!!!
    Any help is highly appreciated!!!!
    Attached Files Attached Files

  2. #2
    C++まいる!Cをこわせ!
    Join Date
    Oct 2007
    Location
    Inside my computer
    Posts
    24,654
    OK, first of all, make sure to add 'extern "C"' before all function you are trying to call in the library.
    Alternatively, do
    Code:
    extern "C"
    {
    	// Functions here
    }
    And you say that are the required files have been added to the project?
    And just a note that your call in main will crash your program if you get it running. Perhaps you should read the documentation for the library you are trying to use?
    Quote Originally Posted by Adak View Post
    io.h certainly IS included in some modern compilers. It is no longer part of the standard for C, but it is nevertheless, included in the very latest Pelles C versions.
    Quote Originally Posted by Salem View Post
    You mean it's included as a crutch to help ancient programmers limp along without them having to relearn too much.

    Outside of your DOS world, your header file is meaningless.

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Replies: 8
    Last Post: 12-08-2009, 02:47 AM
  2. Difference between char *str1 & const char *str2
    By Tigers! in forum C Programming
    Replies: 4
    Last Post: 08-06-2009, 04:04 AM
  3. Read File To Char Array with Null char init
    By MicroFiend in forum Windows Programming
    Replies: 1
    Last Post: 10-28-2003, 06:18 PM
  4. Assigning Const Char*s, Char*s, and Char[]s to wach other
    By Inquirer in forum Linux Programming
    Replies: 1
    Last Post: 04-29-2003, 10:52 PM
  5. unsigned char vs signed char and range of values
    By Silvercord in forum C++ Programming
    Replies: 5
    Last Post: 01-22-2003, 01:30 PM